<?php

namespace App\Http\Controllers\Api\V1\Ali;

use App\Http\Controllers\ApiBaseController;
use App\Libs\Commons\MyMessage;
use App\Services\Aliyun\StsService;
use Illuminate\Support\Facades\Validator;

class StsController extends ApiBaseController
{

	public function policy()
	{
		$param = request()->all();
		$validator = Validator::make($param, [
			'path' => 'required',
		]);
		if ($validator->fails()) {
			return $this->fail(MyMessage::PARAM_LOSE, $validator->errors()->first());
		}

		$result = StsService::policy($param);
		return $this->success($result);
	}
}
